home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-04  |  4.7 KB  |  178 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        EPPC.h
  3.  
  4.      Contains:    High Level Event Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1.3
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __EPPC__
  21. #define __EPPC__
  22.  
  23.  
  24. #ifndef __ERRORS__
  25. #include <Errors.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __APPLETALK__
  30. #include <AppleTalk.h>
  31. #endif
  32. /*    #include <Types.h>                                            */
  33. /*    #include <OSUtils.h>                                        */
  34. /*        #include <MixedMode.h>                                    */
  35. /*        #include <Memory.h>                                        */
  36.  
  37. #ifndef __FILES__
  38. #include <Files.h>
  39. #endif
  40. /*    #include <Finder.h>                                            */
  41.  
  42. #ifndef __PPCTOOLBOX__
  43. #include <PPCToolbox.h>
  44. #endif
  45.  
  46. #ifndef __PROCESSES__
  47. #include <Processes.h>
  48. #endif
  49. /*    #include <Events.h>                                            */
  50. /*        #include <Quickdraw.h>                                    */
  51. /*            #include <QuickdrawText.h>                            */
  52.  
  53. #ifndef __EVENTS__
  54. #include <Events.h>
  55. #endif
  56.  
  57. #ifdef __cplusplus
  58. extern "C" {
  59. #endif
  60.  
  61. #if PRAGMA_ALIGN_SUPPORTED
  62. #pragma options align=mac68k
  63. #endif
  64.  
  65. #if PRAGMA_IMPORT_SUPPORTED
  66. #pragma import on
  67. #endif
  68.  
  69.  
  70. enum {
  71. /* postOptions currently supported */
  72.     receiverIDMask                = 0x0000F000,
  73.     receiverIDisPSN                = 0x00008000,
  74.     receiverIDisSignature        = 0x00007000,
  75.     receiverIDisSessionID        = 0x00006000,
  76.     receiverIDisTargetID        = 0x00005000,
  77.     systemOptionsMask            = 0x00000F00,
  78.     nReturnReceipt                = 0x00000200,
  79.     priorityMask                = 0x000000FF,
  80.     nAttnMsg                    = 0x00000001
  81. };
  82.  
  83. enum {
  84. /* constant for return receipts */
  85.     HighLevelEventMsgClass        = 'jaym',
  86.     rtrnReceiptMsgID            = 'rtrn'
  87. };
  88.  
  89. enum {
  90.     msgWasPartiallyAccepted        = 2,
  91.     msgWasFullyAccepted            = 1,
  92.     msgWasNotAccepted            = 0
  93. };
  94.  
  95. struct TargetID {
  96.     long                            sessionID;
  97.     PPCPortRec                        name;
  98.     LocationNameRec                    location;
  99.     PPCPortRec                        recvrName;
  100. };
  101. typedef struct TargetID TargetID;
  102.  
  103. typedef TargetID *TargetIDPtr, **TargetIDHandle, **TargetIDHdl;
  104.  
  105. typedef TargetID SenderID;
  106.  
  107. typedef SenderID *SenderIDPtr;
  108.  
  109. struct HighLevelEventMsg {
  110.     unsigned short                    HighLevelEventMsgHeaderLength;
  111.     unsigned short                    version;
  112.     unsigned long                    reserved1;
  113.     EventRecord                        theMsgEvent;
  114.     unsigned long                    userRefcon;
  115.     unsigned long                    postingOptions;
  116.     unsigned long                    msgLength;
  117. };
  118. typedef struct HighLevelEventMsg HighLevelEventMsg;
  119.  
  120. typedef HighLevelEventMsg *HighLevelEventMsgPtr, **HighLevelEventMsgHandle, **HighLevelEventMsgHdl;
  121.  
  122. typedef pascal Boolean (*GetSpecificFilterProcPtr)(void *contextPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  123.  
  124. #if GENERATINGCFM
  125. typedef UniversalProcPtr GetSpecificFilterUPP;
  126. #else
  127. typedef GetSpecificFilterProcPtr GetSpecificFilterUPP;
  128. #endif
  129.  
  130. enum {
  131.     uppGetSpecificFilterProcInfo = kPascalStackBased
  132.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  133.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void*)))
  134.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(HighLevelEventMsgPtr)))
  135.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(TargetID*)))
  136. };
  137.  
  138. #if GENERATINGCFM
  139. #define NewGetSpecificFilterProc(userRoutine)        \
  140.         (GetSpecificFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  141. #else
  142. #define NewGetSpecificFilterProc(userRoutine)        \
  143.         ((GetSpecificFilterUPP) (userRoutine))
  144. #endif
  145.  
  146. #if GENERATINGCFM
  147. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender)        \
  148.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, (contextPtr), (msgBuff), (sender))
  149. #else
  150. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender)        \
  151.         (*(userRoutine))((contextPtr), (msgBuff), (sender))
  152. #endif
  153.  
  154. extern pascal OSErr PostHighLevelEvent(const EventRecord *theEvent, unsigned long receiverID, unsigned long msgRefcon, void *msgBuff, unsigned long msgLen, unsigned long postingOptions)
  155.  THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  156. extern pascal OSErr AcceptHighLevelEvent(TargetID *sender, unsigned long *msgRefcon, void *msgBuff, unsigned long *msgLen)
  157.  THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  158. extern pascal OSErr GetProcessSerialNumberFromPortName(const PPCPortRec *portName, ProcessSerialNumber *pPSN)
  159.  THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  160. extern pascal OSErr GetPortNameFromProcessSerialNumber(PPCPortRec *portName, const ProcessSerialNumber *pPSN)
  161.  THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  162. extern pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterUPP aFilter, void *contextPtr, OSErr *err)
  163.  THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  164.  
  165. #if PRAGMA_IMPORT_SUPPORTED
  166. #pragma import off
  167. #endif
  168.  
  169. #if PRAGMA_ALIGN_SUPPORTED
  170. #pragma options align=reset
  171. #endif
  172.  
  173. #ifdef __cplusplus
  174. }
  175. #endif
  176.  
  177. #endif /* __EPPC__ */
  178.